﻿@model PlmSupervisorLogViewModel
@{
    Layout = null;
    ViewBag.Title = "监理员日志添加";
}
<script src="/Scripts/jQuery/jquery.validate.min.js" type="text/javascript"></script>
<script src="/Scripts/jQuery/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
@{Html.EnableClientValidation();}
@using (Html.BeginForm("SupervisorLogAddHandle", "PlmSupervisorLog", null, FormMethod.Post, new { onsubmit = "return validateCallback(this,dialogAjaxDone);", @class = "pageForm required-validate" }))
{
@*<form method="post" action="/PlmSupervisorLog/SupervisorLogAddHandle" class="pageForm required-validate" onsubmit="return validateCallback(this,dialogAjaxDone)">*@
    @Html.HiddenFor(m => m.OperationType, new { Value = @ViewBag.OperationType })
    @Html.HiddenFor(model => model.ThePlmSupervisorlog.Sl_ID)
    <div class="pageContent">
        <div class="pageFormContent" layouth="60">
            <dl style="display: none">
                <dt>操作人：</dt>
                <dd>
                    @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_UserName, new { @readonly = "true", Value = "管理员" })
                </dd>
            </dl>
            <dl style="display: none">
                <dt>操作日期：</dt>
                <dd>
                    @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_UpdateTime, new { @readonly = "true", Value = @DateTime.Now.ToString("yyyy-MM-dd") })
                </dd>
            </dl>
            <dl>
                <dt>标段：</dt>
                <dd>
                     @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_ContractNumber, new Dictionary<string, object> { { "class", "data-val-required input02" }})
                    @Html.ValidationMessageFor(model => model.ThePlmSupervisorlog.Sl_ContractNumber)
                   @* @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_ContractNumber, new { @class = "required" })*@
                </dd>
            </dl>
            <dl>
                <dt>记录日期：</dt>
                <dd>
                    @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_RecordDate, new { @class = "date required",Value=Model.ThePlmSupervisorlog.Sl_RecordDate.ToString("yyyy-MM-dd") })
                </dd>
            </dl>

            <dl>
                <dt>记录人：</dt>
                <dd>
                    @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_RecordUser, new Dictionary<string, object> { { "class", "data-val-required input02" }})
                    @Html.ValidationMessageFor(model => model.ThePlmSupervisorlog.Sl_RecordUser)
                   @* @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_RecordUser, new { @class = "required" })*@
                </dd>
            </dl>
            <dl>
                <dt>专业职位：</dt>
                <dd>
                    @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_SpecialtyPosition, new Dictionary<string, object> { { "class", "data-val-required input02" }})
                    @Html.ValidationMessageFor(model => model.ThePlmSupervisorlog.Sl_SpecialtyPosition)
                    @*@Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_SpecialtyPosition, new { @class = "required" })*@
                </dd>
            </dl>
            <dl class="nowrap">
                <dt>监理单位：</dt>
                <dd>
                    @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_SupervisorName, new Dictionary<string, object> { { "class", "data-val-required input02" }})
                    @Html.ValidationMessageFor(model => model.ThePlmSupervisorlog.Sl_SupervisorName)
                   @* @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_SupervisorName, new { @class = "required", size = 60 })*@
                </dd>
            </dl>
            <dl class="nowrap">
                <dt>监理范围：</dt>
                <dd>
                    @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_SupervisorScope, new { size = 60 })
                </dd>
            </dl>
            <div class="divider"></div>
            <h3>&nbsp;监理日志</h3>
            <dl>
                <dt>监理日志编号：</dt>
                <dd>
                    @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_SupervisionNumber, new Dictionary<string, object> { { "class", "data-val-required input02" }})
                    @Html.ValidationMessageFor(model => model.ThePlmSupervisorlog.Sl_SupervisionNumber)
                  @*  @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_SupervisionNumber, new { @class = "required" })*@
                </dd>
            </dl>
            <dl>
                <dt>审核人：</dt>
                <dd>
                    @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_AuditMan)
                </dd>
            </dl>
            <dl>
                <dt>天气情况：</dt>
                <dd>
                    @Html.TextBoxFor(model => model.ThePlmSupervisorlog.Sl_Weather)
                </dd>
            </dl>
            <dl class="nowrap">
                <dt>主要施工情况：</dt>
                <dd>
                    @Html.TextAreaFor(model => model.ThePlmSupervisorlog.Sl_ConstructionSituation, new { cols = "80", rows = "5" })
                </dd>
            </dl>
            <dl class="nowrap">
                <dt>监理主要工作：</dt>
                <dd>
                    @Html.TextAreaFor(model => model.ThePlmSupervisorlog.Sl_SupervisorJob, new { cols = "80", rows = "5" })
                </dd>
            </dl>
            <dl class="nowrap">
                <dt>问题及处理情况：</dt>
                <dd>
                    @Html.TextAreaFor(model => model.ThePlmSupervisorlog.Sl_ProblemsDispose, new { cols = "80", rows = "5" })
                </dd>
            </dl>
              <dl>
                <dt>附件：</dt>
                <dd>
                     <input id="AssistID" name="AssistID" value="@ViewBag.AssisId" type="hidden"/>
                   <a href='/Common/UploaderFile/Uploader/?id=ZDFileID' width="710" height="460" rel="rel_WorkFlow_WorksMeasure_Attach" mask="true" target="dialog" title="附件管理">
                      <img src="/Content/themes/default/images/fj.gif" alt="查看附件" id='ZDFileID' 
                       uploaderoption="{MoudleID:@ViewBag.MoudleID,'ToSelectIDs':[@ViewBag.FileIds],'ToDeleteIDs':[@ViewBag.DeleteIds],BizDeleteURL:'/PersonnelLog/Base/Delete/',BizSaveUrl:'/PersonnelLog/Base/BatchAdd/',BizType:'SupervisorLog_Rules',BizID:'@ViewBag.AssisId','dirWhere':'@ViewBag.DirWhere'}" />
                       </a>
                </dd>
            </dl>

            <div class="divider"></div>
            <input type="button" class="btn btn-link btn-sm" style="font-weight: 900;" value="添加旁站记录" onclick="addCJJL()" /><input type="hidden" id="input_cjjl" value="1" />
            <div id="div_tabs" class="tabs" style="text-align: center;">
                <div class="tabsHeader">
                    <div class="tabsHeaderContent">
                        <ul id="ul_cjjl">
                            <li class="selected" name="li_cjjl_list" id='li_cjjl_0"'><a href="javascript:void(0)"><span>旁站记录1</span></a></li>
                        </ul>
                    </div>
                </div>
                <div class="tabsContent" style="height: 320px;" id="div_cjjl">
                    <div name="div_cjjl_list" id="div_cjjl_0">
                        <div>
                            <dl>
                                <dt>旁站记录编号：</dt>
                                <dd>
                                    @Html.TextBoxFor(model => model.ThePlmSupervisorlogSubList[0].SlS_CheckNumber, new { @class = "required" })
                                </dd>
                            </dl>
                            <dl>
                                <dt>旁站人：</dt>
                                <dd>
                                    @Html.TextBoxFor(model => model.ThePlmSupervisorlogSubList[0].SlS_SideMan)
                                </dd>
                            </dl>
                            <dl>
                                <dt>旁站时间：</dt>
                                <dd>
                                    @Html.TextBoxFor(model => model.ThePlmSupervisorlogSubList[0].SlS_SideTime, new { @class = "date" })
                                </dd>
                            </dl>
                            <dl>
                                <dt>合同段：</dt>
                                <dd>
                                    @Html.TextBoxFor(model => model.ThePlmSupervisorlogSubList[0].SlS_ContractSection)
                                </dd>
                            </dl>
                            <dl class="nowrap">
                                <dt>施工单位：</dt>
                                <dd>
                                    @Html.TextBoxFor(model => model.ThePlmSupervisorlogSubList[0].SlS_ConstructionName, new { size = 60 })
                                </dd>
                            </dl>

                            <dl class="nowrap">
                                <dt>旁站项目：</dt>
                                <dd>
                                    @Html.TextAreaFor(model => model.ThePlmSupervisorlogSubList[0].SlS_SideProject, new { cols = "80", rows = "5" })
                                </dd>
                            </dl>
                            <dl class="nowrap">
                                <dt>施工过程简述：</dt>
                                <dd>
                                    @Html.TextAreaFor(model => model.ThePlmSupervisorlogSubList[0].SlS_ConstructionSketch, new { cols = "80", rows = "5" })

                                </dd>
                            </dl>
                            <dl class="nowrap">
                                <dt>旁站工作情况：</dt>
                                <dd>
                                    @Html.TextAreaFor(model => model.ThePlmSupervisorlogSubList[0].SlS_SideJob, new { cols = "80", rows = "5" })

                                </dd>
                            </dl>
                            <dl class="nowrap">
                                <dt>主要数据记录：</dt>
                                <dd>
                                    @Html.TextAreaFor(model => model.ThePlmSupervisorlogSubList[0].SlS_DateRecord, new { cols = "80", rows = "5" })

                                </dd>
                            </dl>
                            <dl class="nowrap">
                                <dt>发现的问题及处理结果：</dt>
                                <dd>
                                    @Html.TextAreaFor(model => model.ThePlmSupervisorlogSubList[0].SlS_DisposeResult, new { cols = "80", rows = "5" })

                                </dd>
                            </dl>
                         
                        </div>
                    </div>
                </div>
                <div class="tabsFooter">
                    <div class="tabsFooterContent"></div>
                </div>
            </div>

            <div class="divider"></div>
            <input type="button" class="btn btn-link btn-sm" style="font-weight: 900;" value="添加隐蔽工程记录" onclick="addCJJLYB()" /><input type="hidden" id="input_cjjlYB" value="1" />
            <div id="div_tabsYB" class="tabs" style="text-align: center;">
                <div class="tabsHeader">
                    <div class="tabsHeaderContent">
                        <ul id="ul_cjjlYB">
                            <li class="selected" name="li_cjjlYB_list" id='li_cjjlYB_0"'><a href="javascript:void(0)"><span>隐蔽工程记录1</span></a></li>
                        </ul>
                    </div>
                </div>
                <div class="tabsContent" style="height: 320px;" id="div_cjjlYB">
                    <div name="div_cjjlYB_list" id="div_cjjlYB_0">
                        <div>
                            <dl>
                                <dt>隐蔽工程记录编号：</dt>
                                <dd>
                                    @Html.TextBoxFor(model => model.ThePlmSupervisorlogYBSubList[0].SlYS_CheckNumber, new { @class = "required" })
                                </dd>
                            </dl>
                            <dl>
                                <dt>旁站人：</dt>
                                <dd>
                                    @Html.TextBoxFor(model => model.ThePlmSupervisorlogYBSubList[0].SlYS_SideMan)
                                </dd>
                            </dl>
                            <dl>
                                <dt>旁站时间：</dt>
                                <dd>
                                    @Html.TextBoxFor(model => model.ThePlmSupervisorlogYBSubList[0].SlYS_SideTime, new { @class = "date" })
                                </dd>
                            </dl>
                            <dl>
                                <dt>合同段：</dt>
                                <dd>
                                    @Html.TextBoxFor(model => model.ThePlmSupervisorlogYBSubList[0].SlYS_ContractSection)
                                </dd>
                            </dl>
                            <dl class="nowrap">
                                <dt>施工单位：</dt>
                                <dd>
                                    @Html.TextBoxFor(model => model.ThePlmSupervisorlogYBSubList[0].SlYS_ConstructionName, new { size = 60 })
                                </dd>
                            </dl>

                            <dl class="nowrap">
                                <dt>旁站项目：</dt>
                                <dd>
                                    @Html.TextAreaFor(model => model.ThePlmSupervisorlogYBSubList[0].SlYS_SideProject, new { cols = "80", rows = "5" })
                                </dd>
                            </dl>
                            <dl class="nowrap">
                                <dt>施工过程简述：</dt>
                                <dd>
                                    @Html.TextAreaFor(model => model.ThePlmSupervisorlogYBSubList[0].SlYS_ConstructionSketch, new { cols = "80", rows = "5" })

                                </dd>
                            </dl>

                        </div>
                    </div>
                </div>
                <div class="tabsFooter">
                    <div class="tabsFooterContent"></div>
                </div>
            </div>
            </div>
            <div class="formBar">
                <ul>
                    @if (@ViewBag.OperationType != "view")
                    {
                        <li>
                            <button type="submit" class="btn btn-sm">保存</button>
                        </li>
                    }
                    <li>
                        <button type="button" class="close btn btn-default btn-sm">取消</button>
                    </li>

                </ul>
            </div>

        </div>
@*</form>*@
}

<script>
    function addCJJL() {
        var index = $("#input_cjjl").val();
        $("#ul_cjjl").append("<li name='li_cjjl_list' id='li_cjjl_" + index + "'><a href='javascript:void(0)'><span>旁站记录" + parseInt(parseInt(index) + 1) + "</span></a></li>");
        $("#div_cjjl").append(htmlCJJL(index));
        $("#div_cjjl_" + index).initUI();
        $("#div_tabs").tabs({ currentIndex: index });

        $("#input_cjjl").val(parseInt(parseInt(index) + 1));
    }
    function htmlCJJL(index) {
        var cjjlStr =
   '<div name="div_cjjl_list" id="div_cjjl_' + index + '">' +
            '<div style="text-align:left;margin-left:25px;"><input id="delCJJL' + index + '" type="button" value="删除该条记录" onclick="delCJJL(' + index + ')"/></div><div><dl><dt>旁站记录编号：</dt> ' +
               '<dd>' +
                 '<input class="required textInput" id="ThePlmSupervisorlogSubList_' + index + '__SlS_CheckNumber" name="ThePlmSupervisorlogSubList[' + index + '].SlS_CheckNumber" type="text" value="">' +
               '</dd>' +
       '</dl>' +
        '<dl>' +
           '<dt>旁站人：</dt>' +
           '<dd>' +
                '<input id="ThePlmSupervisorlogSubList_' + index + '__SlS_SideMan" name="ThePlmSupervisorlogSubList[' + index + '].SlS_SideMan" type="text" value="" class="textInput">' +
           '</dd>' +
       '</dl>' +
           ' <dl>' +
           '  <dt>旁站时间：</dt>' +
           '  <dd>' +
             '<input id="ThePlmSupervisorlogSubList_' + index + '__SlS_SideTime" name="ThePlmSupervisorlogSubList[' + index + '].SlS_SideTime" type="text" class="date textInput">' +
           ' </dd>' +
           '</dl>' +
           ' <dl class="nowrap">' +
           '   <dt>合同段：</dt>' +
           '  <dd>' +
           '<input id="ThePlmSupervisorlogSubList_' + index + '__SlS_ContractSection" name="ThePlmSupervisorlogSubList[' + index + '].SlS_ContractSection" type="text" value="" class="textInput">' +
           '   </dd>' +
           '</dl>' +
           ' <dl class="nowrap">' +
           '    <dt>施工单位：</dt>' +
           '    <dd>' +

           '<input id="ThePlmSupervisorlogSubList_' + index + '__SlS_ConstructionName" name="ThePlmSupervisorlogSubList[' + index + '].SlS_ConstructionName" size="60" type="text" value="" class="textInput">' +
           '    </dd>' +
           '  </dl>' +
           '   <dl class="nowrap">' +
           '       <dt>旁站项目：</dt>' +
           '       <dd>' +
           '<textarea cols="80" id="ThePlmSupervisorlogSubList_' + index + '__SlS_SideProject" name="ThePlmSupervisorlogSubList[' + index + '].SlS_SideProject" rows="5" class="textInput"></textarea>' +
           '       </dd>' +
           '   </dl>' +

           '   <dl class="nowrap">' +
           '       <dt>施工过程简述：</dt>' +
           '       <dd>' +
           '<textarea cols="80" id="ThePlmSupervisorlogSubList_' + index + '__SlS_ConstructionSketch" name="ThePlmSupervisorlogSubList[' + index + '].SlS_ConstructionSketch" rows="5" class="textInput"></textarea>' +
           '       </dd>' +
           '   </dl>' +
           '   <dl class="nowrap">' +
           '       <dt>旁站工作情况：</dt>' +
           '       <dd>' +

           '<textarea cols="80" id="ThePlmSupervisorlogSubList_' + index + '__SlS_SideJob" name="ThePlmSupervisorlogSubList[' + index + '].SlS_SideJob" rows="5" class="textInput"></textarea>' +
           '       </dd>' +
           '   </dl>' +
           '   <dl class="nowrap">' +
           '       <dt>主要数据记录：</dt>' +
           '       <dd>' +
           '<textarea cols="80" id="ThePlmSupervisorlogSubList_' + index + '__SlS_DateRecord" name="ThePlmSupervisorlogSubList[' + index + '].SlS_DateRecord" rows="5" class="textInput"></textarea>' +
           '       </dd>' +
           '   </dl>' +

             '   <dl class="nowrap">' +
           '       <dt>发现的问题及处理结果：</dt>' +
           '       <dd>' +
           '<textarea cols="80" id="ThePlmSupervisorlogSubList_' + index + '__SlS_DisposeResult" name="ThePlmSupervisorlogSubList[' + index + '].SlS_DisposeResult" rows="5" class="textInput"></textarea>' +
           '       </dd>' +
         
           '   </dl></div>' +
         '</div>';
        return cjjlStr;
    }

    function delCJJL(index) {
        $("#li_cjjl_" + index).remove();
        $("#div_cjjl_" + index).remove();

        listNum = $("#input_cjjl").val();
        listNum = parseInt(parseInt(listNum) - 1);
        $("#input_cjjl").val(listNum);
        for (var i = 1; i < listNum; i++) {
            var listObj = $("li[name='li_cjjl_list']:eq(" + i + ")");
            listObj.html("<a href='javascript:void(0)'><span>旁站记录" + (i + 1) + "</span></a>");
            listObj.attr("id", "li_cjjl_" + i);

            var divObj = $("div[name='div_cjjl_list']:eq(" + i + ")");
            divObj.find("input[type='text']").each(function () {
                this.id = "ThePlmSupervisorlogSubList_" + i + "__." + this.name.split('.')[1]
                this.name = "ThePlmSupervisorlogSubList[" + i + "]." + this.name.split('.')[1]
            });
            divObj.find("textarea").each(function () {
                this.id = "ThePlmSupervisorlogSubList_" + i + "__." + this.name.split('.')[1]
                this.name = "ThePlmSupervisorlogSubList[" + i + "]." + this.name.split('.')[1]
            });
            divObj.find("input[type='button']:eq(0)").attr("onclick", "delCJJL('" + i + "')");
            divObj.attr("id", "div_cjjl_" + i);
            divObj.find("input[type='button']:eq(0)").attr("id", "delCJJL" + i);
        }

        $("#div_tabs").tabs({ currentIndex: parseInt(parseInt(index) - 1) });
        $("input[id^=delCJJL]").unbind();
        $("input[id^=delCJJL]").bind("click",
            function () {
                var length = "delCJJL".length;
                var index = parseInt(this.id.substring(length)) ;
                delCJJL(index);
                $(this).unbind();
            });
    }
    //YB
    function addCJJLYB() {
        var index = $("#input_cjjlYB").val();
        $("#ul_cjjlYB").append("<li name='li_cjjlYB_list' id='li_cjjlYB_" + index + "'><a href='javascript:void(0)'><span>隐蔽工程记录" + parseInt(parseInt(index) + 1) + "</span></a></li>");
        $("#div_cjjlYB").append(htmlCJJLYB(index));
        $("#div_cjjlYB_" + index).initUI();
        $("#div_tabsYB").tabs({ currentIndex: index });

        $("#input_cjjlYB").val(parseInt(parseInt(index) + 1));
    }
    function htmlCJJLYB(index) {
        var cjjlStr =
   '<div name="div_cjjlYB_list" id="div_cjjlYB_' + index + '">' +
            '<div style="text-align:left;margin-left:25px;"><input id="delCJJLYB' + index + '" type="button" value="删除该条记录" onclick="delCJJLYB(' + index + ')"/></div><div><dl><dt>隐蔽工程记录编号：</dt> ' +
               '<dd>' +
                 '<input class="required textInput" id="ThePlmSupervisorlogYBSubList_' + index + '__SlYS_CheckNumber" name="ThePlmSupervisorlogYBSubList[' + index + '].SlYS_CheckNumber" type="text" value="">' +
               '</dd>' +
       '</dl>' +
        '<dl>' +
           '<dt>旁站人：</dt>' +
           '<dd>' +
                '<input id="ThePlmSupervisorlogYBSubList_' + index + '__SlS_SideMan" name="ThePlmSupervisorlogYBSubList[' + index + '].SlYS_SideMan" type="text" value="" class="textInput">' +
           '</dd>' +
       '</dl>' +
           ' <dl>' +
           '  <dt>旁站时间：</dt>' +
           '  <dd>' +
             '<input id="ThePlmSupervisorlogYBSubList_' + index + '__SlS_SideTime" name="ThePlmSupervisorlogYBSubList[' + index + '].SlYS_SideTime" type="text" class="date textInput">' +
           ' </dd>' +
           '</dl>' +
           ' <dl class="nowrap">' +
           '   <dt>合同段：</dt>' +
           '  <dd>' +
           '<input id="ThePlmSupervisorlogYBSubList_' + index + '__SlS_ContractSection" name="ThePlmSupervisorlogYBSubList[' + index + '].SlYS_ContractSection" type="text" value="" class="textInput">' +
           '   </dd>' +
           '</dl>' +
           ' <dl class="nowrap">' +
           '    <dt>施工单位：</dt>' +
           '    <dd>' +

           '<input id="ThePlmSupervisorlogYBSubList_' + index + '__SlS_ConstructionName" name="ThePlmSupervisorlogYBSubList[' + index + '].SlYS_ConstructionName" size="60" type="text" value="" class="textInput">' +
           '    </dd>' +
           '  </dl>' +
           '   <dl class="nowrap">' +
           '       <dt>旁站项目：</dt>' +
           '       <dd>' +
           '<textarea cols="80" id="ThePlmSupervisorlogYBSubList_' + index + '__SlS_SideProject" name="ThePlmSupervisorlogYBSubList[' + index + '].SlYS_SideProject" rows="5" class="textInput"></textarea>' +
           '       </dd>' +
           '   </dl>' +

           '   <dl class="nowrap">' +
           '       <dt>施工过程简述：</dt>' +
           '       <dd>' +
           '<textarea cols="80" id="ThePlmSupervisorlogYBSubList_' + index + '__SlS_ConstructionSketch" name="ThePlmSupervisorlogYBSubList[' + index + '].SlYS_ConstructionSketch" rows="5" class="textInput"></textarea>' +
           '       </dd>' +
         
           '   </dl></div>' +
         '</div>';
        return cjjlStr;
    }

    function delCJJLYB(index) {
        $("#li_cjjlYB_" + index).remove();
        $("#div_cjjlYB_" + index).remove();

        listNum = $("#input_cjjlYB").val();
        listNum = parseInt(parseInt(listNum) - 1);
        $("#input_cjjlYB").val(listNum);
        for (var i = 1; i < listNum; i++) {
            var listObj = $("li[name='li_cjjlYB_list']:eq(" + i + ")");
            listObj.html("<a href='javascript:void(0)'><span>隐蔽工程记录" + (i + 1) + "</span></a>");
            listObj.attr("id", "li_cjjlYB_" + i);

            var divObj = $("div[name='div_cjjlYB_list']:eq(" + i + ")");
            divObj.find("input[type='text']").each(function () {
                this.id = "ThePlmSupervisorlogYBSubList_" + i + "__." + this.name.split('.')[1]
                this.name = "ThePlmSupervisorlogYBSubList[" + i + "]." + this.name.split('.')[1]
            });
            divObj.find("textarea").each(function () {
                this.id = "ThePlmSupervisorlogYBSubList_" + i + "__." + this.name.split('.')[1]
                this.name = "ThePlmSupervisorlogYBSubList[" + i + "]." + this.name.split('.')[1]
            });
            divObj.find("input[type='button']:eq(0)").attr("onclick", "delCJJLYB('" + i + "')");
            divObj.attr("id", "div_cjjlYB_" + i);
            divObj.find("input[type='button']:eq(0)").attr("id", "delCJJLYB" + i);
        }

        $("#div_tabsYB").tabs({ currentIndex: parseInt(parseInt(index) - 1) });
        $("input[id^=delCJJLYB]").unbind();
        $("input[id^=delCJJLYB]").bind("click",
            function () {
                var length = "delCJJLYB".length;
                var index = parseInt(this.id.substring(length)) ;
                delCJJLYB(index);
                $(this).unbind();
            });
    }
</script>
